package com.hmyuan.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.hmyuan.dao.Sys_resourcesMapper;
import com.hmyuan.domain.Sys_resources;
import com.hmyuan.service.SysResourcesService;

@Service("sysResourcesService")
public class SysResourcesServiceImpl implements SysResourcesService {

	@Resource
	Sys_resourcesMapper sys_resourcesMapper;
	
	@Override
	public boolean insert(Sys_resources sys_resources) {
		// TODO Auto-generated method stub
		int num = sys_resourcesMapper.insert(sys_resources);
		return num==1?true:false;
	}

	@Override
	public List<Sys_resources> selectList(Sys_resources sys_resources) {
		// TODO Auto-generated method stub
		return sys_resourcesMapper.selectList(sys_resources);
	}

	@Override
	public Sys_resources selectByPrimaryKey(Long id) {
		// TODO Auto-generated method stub
		return sys_resourcesMapper.selectByPrimaryKey(id);
	}

	@Override
	public boolean updateByPrimaryKeySelective(Sys_resources sys_resources) {
		// TODO Auto-generated method stub
		int num = sys_resourcesMapper.updateByPrimaryKeySelective(sys_resources);
		return num==1?true:false;
	}

	@Override
	public List<Sys_resources> selectListByUserid(Long userid) {
		// TODO Auto-generated method stub
		return sys_resourcesMapper.selectListByUserid(userid);
	}

	@Override
	public List<Sys_resources> selectListByRoleid(Long roleid) {
		// TODO Auto-generated method stub
		return sys_resourcesMapper.selectListByRoleid(roleid);
	}

	@Override
	public List<Sys_resources> selectListOfUserAndRoleByUserid(Long userid) {
		// TODO Auto-generated method stub
		return sys_resourcesMapper.selectListOfUserAndRoleByUserid(userid);
	}

}
